﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HomeProfileProjectAdmin.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality.HomeProfileProjectAdmin" %>
<owc:OwGrid ID="OpenHomeProfileProjectGrid" runat="server" DataSourceID="HomeProfileProjectOds"
    SkinID="OwGridAdmin" OwEnableMessageDisplay="True" OwMessageDisplayType="InPlace"
    AutoGenerateColumns="False" OwMessageDisplayControl="">
    <MasterTableView DataSourceID="HomeProfileProjectOds" DataKeyNames="OpenHomeProfileProjectID">
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="<%$OwR:AddNewRecordText %>"
            RefreshText="<%$ OwR:RefreshText %>"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridBoundColumn DataField="OpenHomeProfileProjectID" FilterControlAltText="Filter Name column"
                HeaderText='<%$ OwR:Code %>' SortExpression="OpenHomeProfileProjectID" UniqueName="OpenHomeProfileProjectID">
            </owct:GridBoundColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText='<%$ OwR: TitleLabel %>'
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="Language" />
                            </td>
                            <td>
                                <%# Eval("LanguageCode") %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="Name" />
                            </td>
                            <td>
                                <b><i>
                                    <%# Eval("Name") %></i></b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="HomeProfileParent" />
                            </td>
                            <td>
                                <%# OwOpenHomeProfileProjectsBLL.OwGetEntity((long?)Eval("ParentID")).Name%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText='<%$ OwR:InfoLabel %>'
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="WorkProcess" />
                            </td>
                            <td>
                                <%# OwOpenHomeProfileWorkProcessBLL.OwGetEntity((long?)Eval("WorkProcessID")).Name%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="HomeProfileDetail" />
                            </td>
                            <td>
                                <%# OwOpenHomeProfileDetailsBLL.OwGetEntity((long?)Eval("OpenHomeProfileDetailID")).FullName%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="Project" />
                            </td>
                            <td>
                                <%-- Error  Project chua co du lieu--%>
                                <%--   <%# OwProjectsBLL.OwGetEntity((long?)Eval("ProjectID")).Title %>--%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Time"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="StartDate" />
                            </td>
                            <td>
                                <%# Eval("StartDate")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="EndDate" />
                            </td>
                            <td>
                                <%# Eval("EndDate")%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$ OwR:CommandLabel %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="IsDeleted" />
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsDeletedCb" runat="server" Checked='<%# Eval("IsDeleted")%>'
                                    AutoPostBack="true" Text='<%# Eval("OpenHomeProfileProjectID")%>' CssClass="HiddenText"
                                    OnCheckedChanged="IsDeletedCb_CheckedChanged" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$ OwR:Modify %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <a href='/Admin/Views/Site/HomeProfileProjectEdit.aspx?ID=<%#Eval("OpenHomeProfileProjectID")%>'>
                        <img src='/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/edit.gif' runat="server"
                            id="UpdateImage" /></a>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:Delete %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <div align="center">
                        <asp:ImageButton CausesValidation="true" OnClientClick='if(!confirm("Are you sure to  Delete?")) return false'
                            ID="EditDeleteButton1" CommandName="Delete" runat="server" SkinID="OwConfirmButton"
                            ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/delete.gif" />
                    </div>
                </ItemTemplate>
            </owct:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <%
                    Response.Redirect("HomeProfileProjectEdit.aspx");
                %>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</owc:OwGrid>
<owc:OwObjectDataSource ID="HomeProfileProjectOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwOpenHomeProfileProjectsEntity"
    DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
    SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwOpenHomeProfileProjectsBLL"
    EnablePaging="true" SelectCountMethod="OwGetByDynamicCount" UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:Parameter Name="parentID" Type="Int64" />
        <asp:Parameter Name="isDeleted" Type="Boolean" DefaultValue="false" />
        <asp:Parameter Name="languageCode" Type="String" />
        <asp:Parameter Name="openHomeProfileDetailID" Type="Int64" />
        <asp:Parameter Name="workProcessID" Type="Int64" />
        <asp:Parameter Name="projectID" Type="Int64" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </SelectParameters>
</owc:OwObjectDataSource>
